<template>
<el-dialog title="借阅详情" :visible.sync="visible" width="700px" append-to-body :close-on-click-modal="false">
  <el-divider content-position="left">借阅信息</el-divider>
  <el-descriptions :column="2" border>
    <el-descriptions-item label="案卷号">{{borrowData.fileCode}}</el-descriptions-item>
    <el-descriptions-item label="提名">{{borrowData.title}}</el-descriptions-item>
    <el-descriptions-item label="借阅人">{{borrowData.createBy}}</el-descriptions-item>
    <el-descriptions-item label="借阅类型">{{borrowData.billName}}</el-descriptions-item>
    <el-descriptions-item label="借出时间">{{borrowData.borrowTime}}</el-descriptions-item>
    <el-descriptions-item label="归还时间">{{borrowData.returnTime}}</el-descriptions-item>
    <el-descriptions-item label="用途" :span="2">{{borrowData.remark}}</el-descriptions-item>
    <el-descriptions-item label="备注" :span="2">{{borrowData.reason}}</el-descriptions-item>
  </el-descriptions>
  <template v-if="borrowData.status !== '0'">
    <el-divider content-position="left">审核信息</el-divider>
    <el-descriptions v-for="item in borrowData.amApprovalList" :column="2" border>
      <el-descriptions-item label="审核人" :span="2">{{ item.applicant }}</el-descriptions-item>
      <el-descriptions-item label="审核意见" :span="2">{{ item.approvalOpinions }}</el-descriptions-item>
    </el-descriptions>
  </template>
  <div slot="footer" class="dialog-footer">
    <el-button @click="cancel">取 消</el-button>
  </div>
</el-dialog>
</template>

<script>
import {getAmBorrow} from "@/api/am/amBorrow";

export default {
  data() {
    return {
      title: '',
      visible: false,
      formTemp: {
        timeRange: []
      },
      form: {
        reason: '',
      },
      rules: {},
      borrowData: {
        amApprovalList: []
      }
    }
  },
  methods: {
    open(borrowData) {
      getAmBorrow(borrowData.id).then(response => {
        this.borrowData = response.data
        console.log(this.borrowData);
        this.visible = true
      })
    },
    submit() {},
    cancel() {
      this.visible = false
    },
  }
}
</script>

<style lang="scss"></style>
